package panda.index;

import panda.query.struct.Constant;
import panda.record.TupleToken;

/**
 * 
 * @author Tian Yuan
 *
 */
public interface Index {
	
	public final static int EQ = 0, NEQ = 1, LT = 2, GT = 3, LTE = 4, GTE = 5;

	/**
	 * Intialize the iterator
	 * @param c
	 * @param op
	 */
	public void findBeforeFirst(Constant c);
	
	public void findSpecial(Constant c, int op);

	/**
	 * Move the iterator to the next tuple
	 * @return whether there exists following tuples
	 */
	public boolean getNext();
	
	/**
	 * Get the token for the current tuple
	 * @return the token
	 */
	public TupleToken getTupleToken();
	
	/**
	 * Close the scanner
	 */
	public void close();

	/**
	 * Insert an entry into the index
	 * @param searchKey
	 * @param tt
	 */
	public void insert(Constant searchKey, TupleToken tt);
	
	/**
	 * Delete the specified entry from the index
	 * @param searchKey
	 * @param tt
	 */
	public void delete(Constant searchKey, TupleToken tt);
}
